package stream;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

/**
 * Created with IDEA
 * author:Yhk
 * Date:2019/2/28
 * Time:11:14 AM
 */
public class stream {

    public static void main(String[] args) {
        List<Integer> list = new ArrayList<>();
        list.add(1);
        list.add(2);
        System.out.println(list.stream().distinct().collect(Collectors.toList()));

    }
}
